Skip to content

test: run the tests on Testo with cycle/testing - #139

Merged
roxblnfk merged 12 commits into
4.xfrom
test/testo
Nov 20, 2026
Merged

roxblnfk merged 12 commits into
4.xfrom
test/testo

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

What was changed

The test suite runs on Testo through the shared cycle/testing harness instead of PHPUnit.

  • tests/Annotated/Functional/Driver/{Common,<Driver>} → tests/Feature/{Common,MySQL,Postgres}. A common test runs in every driver suite, so the 87 generated per-driver stubs go; BaseTestCase extends the harness's OrmTestCase and keeps only the reader providers and the fixture locator.
  • TableTrait, TableRenderer and the TestLogger fixture give way to the harness; PHPUnit mocks of ClassesInterface become ClassList.
  • Composer scripts: test, test:unit, test:<driver>, db:up / db:down (the package's compose file). README gets a Testing section.
  • CI: main.yml calls the shared cycle/gh-actions workflow testo.yml: Unit + SQLite on PHP 8.2–8.6 with highest dependencies and on 8.2 with lowest, MySQL, Postgres and SQL Server on 8.2 and 8.6, Codecov flag per suite.
  • testo.php registers a Regression suite, and composer test:new-case -- <issue> generates a case in tests/Regression from the harness's orm-attributes template.
  • Deleted: phpunit.xml, tests/bootstrap.php, tests/generate.php, tests/docker-compose.yml and the Travis-era shell scripts; PHPUnit leaves require-dev.

Test counts

Suite PHPUnit (4.x) Testo
Unit 44 44
SQLite 197 197
MySQL 200 200
Postgres 206 206
SQLServer 197 203

Deliberate differences:

  • CompositePkGeneratedTest (×6) also runs on SQL Server, the other RETURNING driver its docblock names; PHPUnit ran it on Postgres only.
  • Server drivers run on the lowest and highest PHP (8.2 and 8.6) instead of the full matrix.

Review notes

  • infection.json has no workflow and Infection is not installed; it is left as is and still assumes PHPUnit.

Checklist

  • Tested
    • All suites green locally on SQLite, MySQL 8.0, Postgres 15 and SQL Server 2022, compared per method against the PHPUnit run

PHPUnit stays the test runner until the tests are migrated.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
A mechanical pass of the PHPUNIT_TO_TESTO set, kept apart from the harness migration so the hand-written changes review on their own; the generated per-driver stubs are left for that step to delete.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
The harness runs a common test in every driver suite, so the generated per-driver stubs and their generator go, and the copied table and logger helpers give way to the package. CompositePkGeneratedTest now also runs on SQL Server, the other RETURNING driver its docblock names.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
ci: run each server driver in its own job

docs: describe running the tests in the README

Server drivers run on the lowest and highest supported PHP only, to keep the job count down; the full PHP matrix still runs Unit and SQLite.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk
roxblnfk requested a review from a team November 20, 2026 11:51
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.28%. Comparing base (7994bb4) to head (e922fe3).

Additional details and impacted files
@@             Coverage Diff              @@
##                4.x     #139      +/-   ##
============================================
- Coverage     91.93%   87.28%   -4.65%     
============================================
  Files            39       39              
  Lines           843      873      +30     
============================================
- Hits            775      762      -13     
- Misses           68      111      +43     
Flag Coverage Δ
mysql 90.65% <ø> (?)
postgres 90.77% <ø> (?)
sqlite 90.65% <ø> (?)
sqlserver 90.65% <ø> (?)
unit 12.71% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The PHP matrix job ran the Unit suite without coverage, so Codecov lost the lines only unit tests reach.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk
roxblnfk merged commit 8dae473 into 4.x Nov 20, 2026
20 of 21 checks passed
@roxblnfk
roxblnfk deleted the test/testo branch November 20, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant